<!---- 模板 on 2017/3/30 -->
<script ng-init="initCss();setObject('isBatch',false)"></script>
<div class="page">
    <header class="bar bar-nav">
        <a class="icon icon-left pull-left" href="javascript:history.back(-1);"></a>
        <h1 class="title">设备列表</h1>
        <a class="icon icon-check pull-right" style="font-size: .8rem;text-decoration: underline;color: #f0f0f0"
           ng-if="isBatch" href="javascript:;" ng-click="chooseDeviceAction()">选好了</a>
    </header>
    <div class="content" ng-init="">
        <div class="content-block-title">
            <p>
                <a href="javascript:;" ng-click="gotoRegister('device')">添加设备</a>
                &nbsp;
                <a href="javascript:;" ng-if="!isBatch"
                   ng-click="setObject('isBatch',true);setObject('chooseDevices',[]);">批量操作</a>
                <a href="javascript:;" ng-if="isBatch" ng-click="setObject('isBatch',false)">关闭批量操作</a>
            </p>
            <p>
                <a href="javascript:;" ng-click="orderModel.change()">{{orderModel.chooseOption.name}}</a>
                <a href="javascript:;"
                   ng-click="orderModel.switchOrder()">（{{orderModel.order?'升序排列':'降序排列'}}[触摸改变]）</a>
            </p>
            <p ng-if="devices.length==0"><span style="color:#bbbbbb;">（当前设备列表为空）</span></p>
        </div>
        <div class="list-block">
            <ul>
                <li ng-repeat="device in devices track by device.deviceNo">
                    <label ng-class="{true:'item-content label-checkbox item-link',false:'item-content item-link'}[isBatch]">
                        <input type="checkbox" ng-if="isBatch" ng-model="chooseDevices[$index]">
                        <div class="item-media"><i class="icon icon-form-checkbox"></i></div>
                        <div class="item-inner" ng-click="loadDetailUrl($index)">
                            <div class="item-title">
                                <span class="red" ng-if="device.memorandum&&device.memorandum.exist">!&nbsp;</span>
                                [{{device.deviceNo}}]:{{device.deviceName}}
                            </div>
                            <div class="item-after">
                                <span
                                        style="color: {{device.maintainPlans[0].currentMaxPercentage|invokeObjectMethod:'gradientColorsPercentage':[colorSetting]}}"
                                >&nbsp;&nbsp;&nbsp;{{device.maintainPlans[0].currentMaxPercentage|percentage}}</span>
                                <span
                                        style="color: {{device.maintainPlans[1].currentMaxPercentage|invokeObjectMethod:'gradientColorsPercentage':[colorSetting]}}"
                                >&nbsp;&nbsp;&nbsp;{{device.maintainPlans[1].currentMaxPercentage|percentage}}</span>
                                <span
                                        style="color: {{device.maintainPlans[2].currentMaxPercentage|invokeObjectMethod:'gradientColorsPercentage':[colorSetting]}}"
                                >&nbsp;&nbsp;&nbsp;{{device.maintainPlans[2].currentMaxPercentage|percentage}}</span>
                            </div>
                        </div>
                    </label>
                </li>
            </ul>
        </div>
        <!--内容区-->
    </div>
</div>
<div ng-init="suiMobileInit()"></div>